package cn.ty.znsz.common.interceptor;



import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;

public class PostInterceptor implements Interceptor {

	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		if ("POST".equalsIgnoreCase(controller.getRequest().getMethod().toUpperCase())) {
			inv.invoke();
		}else {
			controller.renderJson(Ret.fail("请求错误！"));
			return;	
		}
	}

}
